package dao.impl;

import dao.AggrStatVisitDao;
import domain.AggrStat;
import domain.BlackList;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import util.JDBCUtils;

import java.util.List;

public class AggrStatVisitDaoImpl implements AggrStatVisitDao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<AggrStat> SelectVisit() {
        String sql = "SELECT visit_length_1s_3s_ratio,visit_length_4s_6s_ratio,visit_length_7s_9s_ratio,visit_length_10s_30s_ratio,visit_length_30s_60s_ratio,visit_length_1m_3m_ratio,visit_length_3m_10m_ratio,visit_length_10m_30m_ratio,visit_length_30m_ratio FROM session_aggr_stat";
        List<AggrStat> query = template.query(sql, new BeanPropertyRowMapper<AggrStat>(AggrStat.class));
        return query;
    }
}
